<template>
  <div class="dashboard-container">
    <div class="flex-container">
      <div>
         <el-row :gutter="20">
          <el-col :span="12">
            <div v-if="data.modifyStaff==='0' || data.salType==='0'" class="widget-box widget-box-task">
              <div class="widget-box-header">
                <h3 class="widget-box-title">
                  新手任务
                </h3>
              </div>
              <div class="widget-box-content">
                <div class="task-info">
                  <h4 class="task-title">完善店铺信息</h4>
                  <p class="task-detail">在使用供应商ERP前，请先设置您的<span class="sui-text" @click="$router.push({name:'warehouse'})">仓库信息</span>     
                    <span v-if="data.salType==='0'">及 <span class="sui-text" @click="$router.push({name:'freight'})">运费模板</span> </span> ，否则无法进行库存上传。</p>
                </div>
              </div>
            </div>
          </el-col>
          <el-col :span="6">
            <div class=""></div>
          </el-col>
        </el-row> 
        <div class="js-new-task new-task" style="display: block;">
        </div>  
      </div>
    </div>

  </div>
</template>

<script>
  import {
    mapGetters
  } from 'vuex'
  import {
    getUserInfo
  } from '@/api/user'
  export default {
    name: 'dashboard',
    data() {
      return {
        data: {}
      }
    },
    computed: {
      ...mapGetters([
        'name',
        'roles'
      ])
    },
    methods: {
      init() {
        // 获取供应商信息
        getUserInfo()
          .then(res => {
            this.data = res.data.uInfo
          })
      }
    },
    mounted() {
      this.init()
    }

  }

</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  @import 'src/assets/css/sui.scss';
  .dashboard {
    &-container {
      margin: 30px;
      .shop-name {
        display: inline-block;
        font-size: 20px;
        line-height: 1em;
        color: #333333;
        margin-bottom: 20px;
        .shop-name-text {
          display: inline-block;
          vertical-align: middle;
          position: relative;
        }
      }
      .widget-box {
        margin-bottom: 40px;
      }
      .widget-box-task {
        font-size: 13px;
        .widget-box-header {
          position: relative;
          padding: 0 0 15px 0;
          .widget-box-title {
            margin: 0;
            font-size: 14px;
            line-height: 14px;
            color: #333333;
            font-weight: bold;
          }
        }
        .widget-box-content {
          padding: 20px;
          background: #F8F8F8;

          .task-info {
            position: relative;
            color: #666;
            .task-title {
              font-weight: bold;
              font-size: 14px;
              line-height: 1em;
              color: #333;
              margin-bottom: 10px;
            }
            .task-detail {
              margin-bottom: 20px;
            }
            .task-opts {
              text-align: right;
            }
          }
        }
      }
    }
  }

</style>
